﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static CN.T.Backend.Application.System.Dtos.DtoDCDirectionCreate;

namespace CN.T.Backend.Application.System.Dtos
{
    public class DtoCreateVoucher
    {
        public DtosCreateVoucher Dtos { get; set; }
    }
    public class DtosCreateVoucher
    {
        /// <summary>
        /// 外部编码，字符串长度<50
        /// </summary>
        public string ExternalCode { get; set; }="111";
        /// <summary>
        /// OpenApi生成凭证，是否忽略用户多传入的辅助项信息
        /// </summary>
        public bool ClearMoreAuxInfo { get; set; }
        /// <summary>
        /// 凭证类别
        /// </summary>
        public DtosCreateVoucherType DocType { get; set; }
        /// <summary>
        /// 凭证号
        /// 数字(0~9)> 0，必须全部是数字不能有其他符号；长度由系统设置，
        /// [系统管理]--[单据设置]—[单据编码设置]—[凭证]—[流水号长度] 如果长度不够，前面补0；如果不传值，会按照规则取号；
        /// 如果传值，需要搭配IsModifiedCode使用
        /// </summary>
        public string? Code { get; set; }
        /// <summary>
        /// 制单日期
        /// </summary>
        public string? VoucherDate { get; set; }
        /// <summary>
        /// 是否修改编号，取值"true"/"false" IsModifiedCode:"true"，
        /// 则用参数中的Code作为凭证编号；手工编码时必录(IsModifiedCode:"true")
        /// </summary>
        public bool IsModifiedCode { get; set; }
        /// <summary>
        /// 附单据数；数字[0，9999]
        /// </summary>
        public int AttachedVoucherNum { get; set; } = 0;
        /// <summary>
        /// 备注；字符串长度<50
        /// </summary>
        public string? Memo { get; set; }
        /// <summary>
        /// 表头动态属性。表头自定义项列：公用数值自定义项（pubuserdefdecm），
        /// 公用字符自定义项（pubuserdefnvc），专用数值自定义项 （priuserdefdecm），
        /// 用字符自定义项（priuserdefnvc）自定义项用法参照：
        /// https://open.chanjet.com/docs/file/apiFile/tcloud/t+xdescription/t+userdefitems
        /// </summary>
        public List<DynamicPropertyKeysItem>? DynamicPropertyKeys { get; set; }
        /// <summary>
        /// 表头动态属性的值,与上面DynamicPropertyKeys相对应
        /// </summary>
        public List<DynamicPropertyValuesItem>? DynamicPropertyValues { get; set; }
        /// <summary>
        /// 分录信息
        /// </summary>
        public DtoEntrysCreate Entrys{ get; set; }

    }
    public class DtoEntrysCreate
    {
        /// <summary>
        /// 摘要，字符串长度<200
        /// </summary>
        public string Summary { get; set; }
        /// <summary>
        /// 科目档案，必须是末级科目
        /// </summary>
        public DtoAccountreate Account { get; set; }
        /// <summary>
        /// 方向
        /// </summary>
        public DtoDCDirectionCreate? DCDirection { get; set; }
        /// <summary>
        /// 汇率，科目启用外币核算必输，否则默认1
        /// </summary>
        public decimal? ExchangeRate { get; set; }
        /// <summary>
        /// 货币；举例：Currency: { Code: "RMB" }
        /// </summary>
        public DtoCurrencyCreate Currency { get; set; }
        /// <summary>
        /// 贷方本币；
        /// </summary>
        public decimal AmountCr { get; set;  }
        /// <summary>
        /// 贷方数量
        /// </summary>
        public decimal? QuantityCr { get; set; }
        /// <summary>
        /// 借方本币；
        /// </summary>
        public decimal AmountDr { get; set; }
        /// <summary>
        /// 借方数量
        /// </summary>
        public decimal? QuantityDr { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal? Price { get; set; }
        /// <summary>
        /// 计量单位
        /// </summary>
        public DtoUnitCreatr? Unit { get; set; }
        /// <summary>
        /// 辅助核算项
        /// </summary>
        public List<DtoAuxlnfosCreate>? AuxInfos { get; set; }
    }
    public class DtoAuxlnfosCreate
    {
        /// <summary>
        /// 业务员；举例：Clerk:{"Code":"01"}
        /// </summary>
        public DtoClerkCreate? Clerk { get; set; }

        /// <summary>
        /// 个人（员工）；举例：AuxAccPerson:{"Code":"01"}
        /// </summary>
        public DtoAuxAccPersonCreate? AuxAccPerson { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc10 ExAuxAcc10 { get; set; }

        /// <summary>
        /// 结算方式；举例：SettleStyle:{"Code":"01"}
        /// </summary>
        public DtoSettleStyleCreate? SettleStyle { get; set; }

        /// <summary>
        /// 账号；举例：BankAccount:{"Code":"01"}
        /// </summary>
        public DtoBankAccountCreate? BankAccount { get; set; }

        /// <summary>
        /// 部门；举例：AuxAccDepartment:{"Code":"01"}
        /// </summary>
        public DtoAuxAccDepartmentCreate? AuxAccDepartment { get; set; }
        /// <summary>
        /// 存货；举例：AuxAccDepartment:{"Code":"01"}
        /// </summary>
        public DtoAuxAccInventoryCreate? AuxAccInventory { get; set; }

        /// <summary>
        /// 项目；举例：AuxAccDepartment:{"Code":"01"}
        /// </summary>
        public DtoAuxAccProjectCreate? AuxAccProject { get; set; }

        /// <summary>
        /// 客户（往来单位）；举例：AuxAccCustomer:{"Code":"01"}
        /// </summary>
        public DtoAuxAccCustomerCreate? AuxAccCustomer { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc5 ExAuxAcc5 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc4 ExAuxAcc4 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc7 ExAuxAcc7 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc6 ExAuxAcc6 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc1 ExAuxAcc1 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc3 ExAuxAcc3 { get; set; }

        
        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc2 ExAuxAcc2 { get; set; }


        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc9 ExAuxAcc9 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public ExAuxAcc8 ExAuxAcc8 { get; set; }

        

        
    }

    public class DtoAuxAccPersonCreate
    {
        /// <summary>
        /// 员工编码
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc10
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoSettleStyleCreate
    {
        /// <summary>
        /// 结算方式编码
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoBankAccountCreate
    {
        /// <summary>
        /// 账号编码
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoAuxAccInventoryCreate
    {
        /// <summary>
        /// 存货编码
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc5
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc4
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc7
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc6
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc1
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc3
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoClerkCreate
    {
        /// <summary>
        /// 业务员编码
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc2
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoAuxAccCustomerCreate
    {
        /// <summary>
        /// 往来单位编码
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc9
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class ExAuxAcc8
    {
        /// <summary>
        /// 
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoAuxAccProjectCreate
    {
        /// <summary>
        /// 项目编码
        /// </summary>
        public string Code { get; set; }

    }



    public class DtoAuxAccDepartmentCreate
    {
        /// <summary>
        /// 部门编码
        /// </summary>
        public string Code { get; set; }

    }


    public class DtoUnitCreatr
    {
        /// <summary>
        /// 计量单位名称
        /// </summary>
        public string? Name { get; set; }
    }
    public class DtoCurrencyCreate
    {
        /// <summary>
        /// 币种编码
        /// </summary>
        public string? Code { get; set; }
    }
    public class DtoDCDirectionCreate
    {
        /// <summary>
        /// 借贷方向编码    00 借方  01 贷方
        /// </summary>
        public string Code { get; set; }
    }
    public class DtoAccountreate
    {
        /// <summary>
        /// 科目编码
        /// </summary>
        public string Code { get; set; }
    }
    public class DynamicPropertyKeysItem
    {
    }
    public class DynamicPropertyValuesItem
    {
    }

    public class DtosCreateVoucherType
    {
        /// <summary>
        /// 凭证字
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 凭证类别名称
        /// </summary>
        public string Name { get; set; }
    }
}
